Skip to content

Conversation

EtienneLt
Copy link
Contributor

No description provided.

@EtienneLt EtienneLt self-assigned this Aug 21, 2025
Signed-off-by: Etienne LESOT <[email protected]>
Signed-off-by: Etienne LESOT <[email protected]>
Signed-off-by: Etienne LESOT <[email protected]>
Signed-off-by: Etienne LESOT <[email protected]>
Signed-off-by: Etienne LESOT <[email protected]>
Signed-off-by: Etienne LESOT <[email protected]>
Signed-off-by: Etienne LESOT <[email protected]>
Signed-off-by: Etienne LESOT <[email protected]>
Signed-off-by: Etienne LESOT <[email protected]>
Signed-off-by: Etienne LESOT <[email protected]>
Signed-off-by: Etienne LESOT <[email protected]>
Copy link

sonarqubecloud bot commented Sep 5, 2025

/**
* @author Slimane Amar <slimane.amar at rte-france.com>
*/
public class BusbarSectionFinderTraverser implements Terminal.TopologyTraverser {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move those changes in another PR. So the review can be done with #288. And the changes in the tests will be reviewed with it

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

}
}

public static ConnectablePositionInfos toMapConnectablePosition(Identifiable<?> identifiable, int index) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
public static ConnectablePositionInfos toMapConnectablePosition(Identifiable<?> identifiable, int index) {
public static ConnectablePositionInfos getConnectablePosition(Identifiable<?> identifiable, ThreeSides side) {

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree with the renaming, but not with changing int index to ThreeSides side, because we need to specify the index to retrieve the feeder

}

static VoltageLevelMapInfos toMapInfos(Identifiable<?> identifiable) {
private static Map<String, List<FeederBayInfos>> getFeederBaysInfos(VoltageLevel voltageLevel) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

    private static Map<String, List<FeederBayInfos>> getFeederBaysInfos(VoltageLevel voltageLevel) {
        Map<String, List<FeederBayInfos>> feederBayInfos = new HashMap<>();
        voltageLevel.getConnectableStream()
            .filter(connectable -> !(connectable instanceof BusbarSection))
            .forEach(connectable -> {
                List<FeederBayInfos> connections = new ArrayList<>();
                connectable.getTerminals().forEach(obj -> {
                    Terminal terminal = (Terminal) obj;
                    if (terminal.getVoltageLevel().getId().equals(voltageLevel.getId())) {
                        connections.add(
                                new FeederBayInfos(
                                    getBusOrBusbarSection(terminal),
                                    getConnectablePosition(connectable, getConnectableSide(terminal).map(side -> side.getNum()).orElse(0)),
                                    getConnectableSide(terminal).orElse(null)
                                )
                        );
                    }
                });
                feederBayInfos.put(connectable.getId(), connections);
            });
        return feederBayInfos;
    }

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

something like this to be more succinct ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

}
}

private static ConnectablePosition.Feeder getFeederInfos(Identifiable<?> identifiable, int index) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This code should use ThreeSides

Suggested change
private static ConnectablePosition.Feeder getFeederInfos(Identifiable<?> identifiable, int index) {
private static ConnectablePosition.Feeder getFeederInfos(Identifiable<?> identifiable, ThreeSides side) {

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With the index we can handle injections and branches, but the ThreeSides type cannot manage that

return convertFeederToConnectablePositionInfos(feeder);
}

public static ConnectablePositionInfos convertFeederToConnectablePositionInfos(ConnectablePosition.Feeder feeder) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
public static ConnectablePositionInfos convertFeederToConnectablePositionInfos(ConnectablePosition.Feeder feeder) {
public static ConnectablePositionInfos buildConnectablePositionInfos(ConnectablePosition.Feeder feeder) {

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

final BusbarSectionFinderTraverser connectedBusbarSectionFinder = new BusbarSectionFinderTraverser(terminal.isConnected());
terminal.traverse(connectedBusbarSectionFinder, TraversalType.BREADTH_FIRST);
return connectedBusbarSectionFinder.getFirstTraversedBbsId();
// NODE_BREAKER: explore all paths and choose the busbar with the closed disconnector
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move those changes in another PR. So the review can be done with #288. And the changes in the tests will be reviewed with it

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants